package cn.stu.cms.service;

import cn.stu.cms.dto.PageDto;
import cn.stu.cms.pojo.Announcement;
import cn.stu.cms.util.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;


/**
 * 公告服务
 *
 * @author gh
 * @date 2023/09/19
 */
public interface AnnouncementService extends IService<Announcement> {

    /**
     * 公告添加
     *
     * @param announcement 公告
     * @return {@link R}
     */
    R<Boolean> add(Announcement announcement);

    /**
     * 公告德尔
     *
     * @param announcementId 公告编号
     * @return {@link R}
     */
    R<Boolean> delete(Long announcementId);

    /**
     * 公告更新
     *
     * @param announcement 公告
     * @return {@link R}
     */
    R<Boolean> edit(Announcement announcement);

    /**
     * 获取页面
     *
     * @param pageDto      页数到页
     * @param announcement 公告
     * @return {@link R}<{@link Page}<{@link Announcement}>>
     */
    R<Page<Announcement>> getPage(PageDto<Announcement> pageDto, Announcement announcement);
}
